import axios from '@/axios'

/**
 * AI聊天
 */
export function aiChat(data) {
    return axios({
        url: '/ai/chat',
        method: 'post',
        data
    })
}

/**
 * 删除AI对话
 */
export function deleteAiConversation(data) {
    return axios({
        url: '/ai/conversation/delete', 
        method: 'post',
        data
    })
}

/**
 * 获取AI聊天历史记录
 */
export function getAiChatHistory(data) {
    return axios({
        url: '/ai/conversation/history',
        method: 'post',
        data
    })
}

/**
 * 创建新对话
 */
export function createNewConversation(data) {
    return axios({
        url: '/ai/conversation/new',
        method: 'post',
        data
    })
}

/**
 * 获取对话列表
 */
export function getConversationList(data) {
    return axios({
        url: '/ai/conversation/list',
        method: 'post',
        data
    })
}

/**
 * 文章划词AI交互
 */
export function textSelectionAi(data) {
    return axios({
        url: '/ai/text-selection',
        method: 'post',
        data
    })
}